package com.hup.minicontroller.common.model.dto;

import com.hup.minicontroller.common.constant.NetConstant.DataType;
import com.hup.utils.io.netty.model.BaseDataPacket;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 触控板触摸事件
 *
 * @author hugan
 * @date 2021/5/9
 */
@Data
@NoArgsConstructor
public class TouchPadTouchRequest implements BaseDataPacket {
    public static final int ACTION_MOVE_START = 1;
    public static final int ACTION_MOVE = 2;
    public static final int ACTION_MOVE_STOP = 3;
    public static final int ACTION_PRESS = 4;
    public static final int ACTION_UP = 5;
    public static final int ACTION_CLICK = 6;

    /**
     * 本类的action
     */
    private int action;
    /**
     * 移动的距离,单位像素,仅 {@link #ACTION_MOVE} 有值
     */
    private int xPx;
    /**
     * 移动的距离,单位像素,仅 {@link #ACTION_MOVE}有值
     */
    private int yPx;

    public TouchPadTouchRequest(int action, int xPx, int yPx) {
        this.action = action;
        this.xPx = xPx;
        this.yPx = yPx;
    }

    @Override
    public int getType() {
        return DataType.TOUCH_PAD_TOUCH;
    }
}
